package com.borderbears.frontend
{
	import com.borderbears.frontend.events.BBEvent;
	
	import flash.events.EventDispatcher;
	
	[Event(type="com.borderbears.frontend.events.BBEvent", name="toggleDebug")]
	public class Application extends EventDispatcher
	{
		
		private static var instance:Application;
		
		private var debug:Boolean = true;
		
		function Application() {
		}
		
		public function setIsDebug(b:Boolean):void {
			debug = b;
			dispatchEvent(new BBEvent(BBEvent.TOGGLE_DEBUG));
		}
		
		public function getIsDebug():Boolean {
			return debug;
		}


		public static function getApplication():Application {
			if (null == instance) {
				instance = new Application();
			}
			return instance;
		}

	}
}